package com.dfbz.demo01;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo03_异常的捕获_多级异常 {


    public static void main(String[] args) {

        try {
//            System.out.println(1 / 0);

            String str = null;
            System.out.println(str.toString());

//            Object obj = new Object();
//            String s = (String) obj;

        } catch (NullPointerException e2){
            e2.printStackTrace();
        } catch (Exception e){
            e.printStackTrace();
        }

        System.out.println("程序执行....");
    }
    public static void test(String[] args) {

        try {
//            System.out.println(1 / 0);

//            String str = null;
//            System.out.println(str.toString());

            Object obj = new Object();
            String s = (String) obj;

        } catch (ArithmeticException e) {
            e.printStackTrace();
        } catch (NullPointerException e2) {
            e2.printStackTrace();
        }

        System.out.println("程序执行....");
    }
}
